clear all;close all;clc

Condition = 'A';
% Condition = 'B';

Left1_Right2 = 2

soundstim = [];
for isentence = 1:10    
    Nsentence = isentence;
    if Condition =='B'
        Nsentence=isentence+10;
    end
    if Nsentence >= 10
        [Y Fs]=audioread(['sentences/JC09' num2str(Nsentence) '.wav']);
%         [Y Fs]=audioread(['JC09' num2str(Nsentence) '.wav']);
    else
        [Y Fs]=audioread(['sentences/JC090' num2str(Nsentence) '.wav']);
    end
    soundstim=[soundstim; Y(:,1)];
end
Fs
dur = length(soundstim)./Fs

SPL = 60;
rms_want = 10.^(SPL/20).*20e-6;
soundstim = soundstim./rms(soundstim).*rms_want;

if Left1_Right2==1
    soundstim_play = [soundstim soundstim.*0];
else
    soundstim_play = [soundstim.*0 soundstim];
end

sound(soundstim_play,Fs)
